package com.cheng.im.common.protobuiler;

import com.cheng.im.common.bean.msg.ProtoMsgV1;

public class MessageAckBuild {

    public static ProtoMsgV1.Message messageAckBuild(ProtoMsgV1.Message sourceMsg, String from,
                                                     String to, String sdkUuid, long msgId) {
        ProtoMsgV1.Message.Builder builder = sourceMsg.toBuilder();
        builder.setType(ProtoMsgV1.HeadType.MESSAGE_ACK);
        builder.clearMessageRequest();
        builder.clearMessageGroupRequest();

        ProtoMsgV1.MessageAck.Builder ackBuild = ProtoMsgV1.MessageAck.newBuilder();
        ackBuild.setFrom(from);
        ackBuild.setTo(to);
        ackBuild.setMsgSdkUuid(sdkUuid);
        ackBuild.setMsgId(msgId);

        builder.setMessageAck(ackBuild);

        return builder.build();
    }
}
